/**
 * 
 */
package loansManagement;

import java.io.Serializable;

import javax.persistence.Embeddable;
import javax.persistence.ManyToOne;

import mediasManagement.Media;
import subscribersManagement.Subscriber;

/** 
 * @author virgil
 */
@Embeddable
public class ReservationId implements Serializable {

	
	public int hashCode() {
		 int result;
	        result = (media != null ? media.hashCode() : 0);
	        result = 31 * result + (subscriber != null ? subscriber.hashCode() : 0);
	        return result;
		  }
		 
		  public boolean equals(Object o) {
			  if (this == o) return true;
			     if (o == null || getClass() != o.getClass()) return false;
			     ReservationId that= (ReservationId) o;
			     if (media != null ? !media.equals(that.media) : that.media != null) return false;
			     if (subscriber != null ? !subscriber.equals(that.subscriber) : that.subscriber!= null)
			            return false;
			 
			     return true;
		  }
	/**
	 * @uml.property  name="media"
	 * @uml.associationEnd  inverse="reservationId:mediasManagement.Media"
	 */
	@ManyToOne
	private Media media;

	/**
	 * Getter of the property <tt>media</tt>
	 * @return  Returns the media.
	 * @uml.property  name="media"
	 */
	public Media getMedia() {
		return media;
	}

	/**
	 * Setter of the property <tt>media</tt>
	 * @param media  The media to set.
	 * @uml.property  name="media"
	 */
	public void setMedia(Media media) {
		this.media = media;
	}

	/**
	 * @uml.property  name="subscriber"
	 * @uml.associationEnd  inverse="reservationId:subscribersManagement.Subscriber"
	 */
	@ManyToOne
	private Subscriber subscriber;

	/**
	 * Getter of the property <tt>subscriber</tt>
	 * @return  Returns the subscriber.
	 * @uml.property  name="subscriber"
	 */
	public Subscriber getSubscriber() {
		return subscriber;
	}

	/**
	 * Setter of the property <tt>subscriber</tt>
	 * @param subscriber  The subscriber to set.
	 * @uml.property  name="subscriber"
	 */
	public void setSubscriber(Subscriber subscriber) {
		this.subscriber = subscriber;
	}

}
